<?php
include("auth.php");
require('db.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Display Trash</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>

<div>
    <h1>Display trash</h1>
</div>

<p><a href="index.php">Home</a></p>
<a href="logout.php">Logout<br></a>
</div>

<?php
//THIS PHP SCRIPT REQUESTS ALL DATA FROM RUBBISH LOCATIONS, AND ECHOS IT OUT ONTO THE PAGE
require('db.php');
$sql = "SELECT * FROM rubbishlocation";
$result = $con->query($sql);

//if there are any results, echo it out to page
if ($result->num_rows > 0) {
  // output data of each row
  while($row = $result->fetch_assoc()) {
    echo "cameraid: " . $row["cameraid"]. " - photoid: " . $row["photoid"]. " - latitude " . $row["latitude"]. " - longitude " . $row["longitude"]. "<br>";
  }
} else {
  echo "0 results";
}

?>

</body>
</html>